﻿using Global.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity
{
    public class Phone : BaseEntity
    {
        public virtual User User { get; set; }
        public string Number { get; set; }
        public string CheckCode { get; protected set; }
        public DateTime? ExpiredTime { get; protected set; }
        public bool SendSuccess { get; set; }
        public string ResponseMessage { get; set; }


        /// <param name="expire">单位分钟</param>
        public virtual void SetCheckCode(int expire)
        {
            ExpiredTime = SystemTime.Now().AddMinutes(expire);
            CheckCode = RandomGenerator.GetNumbers(4);
        }
    }
}
